/********************************************************************************
 * Copyright (c) 2020 Cedalo AG
 *
 * This program and the accompanying materials are made available under the 
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 ********************************************************************************/
'use strict';

/* eslint no-unused-vars: "off" */

const noopPromise = (reason = { code: 'NOT_IMPLEMENTED' }) =>
	Promise.reject(reason);

/**
 * An abstract class representing a repository to access admin data.
 *
 * @class AbstractAdminRepository
 * @public
 */
module.exports = class AbstractStreamsRepository {
	/**
	 * A method to connect to a database.
	 *
	 * @method connect
	 * @public
	 * @return {Promise}
	 */
	connect() {
		return noopPromise();
	}

	/**
	 * A method to setupIndicies to indicies.
	 *
	 * @method setupIndicies
	 * @public
	 * @return {Promise}
	 */
	setupIndicies() {
		return noopPromise();
	}

	/**
	 * A method to get all configurations.
	 *
	 * @method findAllConfigurations
	 * @public
	 * @return {Promise}
	 */
	findAllConfigurations() {
		return noopPromise();
	}

	/**
	 * A method to get all configurations by type (className).
	 *
	 * @method findConfigurationsByType
	 * @param type
	 * @public
	 * @return {Promise}
	 */
	findConfigurationsByType(type) {
		return noopPromise();
	}

	/**
	 * A method to get all configurations by id (uuid generated by client).
	 *
	 * @method findConfigurationById
	 * @param id
	 * @public
	 * @return {Promise}
	 */
	findConfigurationById(id) {
		return noopPromise();
	}

	/**
	 * A method to save (insert or update) a configuration.
	 *
	 * @method saveConfiguration
	 * @param configuration
	 * @public
	 * @return {Promise}
	 */
	saveConfiguration(configuration) {
		return noopPromise();
	}

	/**
	 * A method to delete configuration by id (uuid).
	 *
	 * @method deleteConfiguration
	 * @param id
	 * @public
	 * @return {Promise}
	 */
	deleteConfiguration(id) {
		return noopPromise();
	}

	/**
	 * A method to delete all configurations.
	 *
	 * @method deleteAllConfigurations
	 * @public
	 * @return {Promise}
	 */
	deleteAllConfigurations() {
		return noopPromise();
	}
};
